package com.lei.study.cds.unit1;

import org.apache.commons.lang3.StringUtils;
import org.mvel2.MVEL;
import org.mvel2.ParserContext;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;

/**
 * @author 伍磊
 */
public class Test2 {

    private static final String avg = "def AVG(double... avgs) {\n" +
            "    count = avgs.length;\n" +
            "    sum = 0;\n" +
            "    for (int i = 0; i < count; i++) {\n" +
            "        sum += avgs[i];\n" +
            "    }\n" +
            "    return sum / count\n" +
            "}\n" +
            "\n";

    private static final Map<String, Object> MAP = new HashMap<>();

    public static void main(String[] args) throws NoSuchMethodException {
        // System.out.println(Integer.parseInt(StringUtils.substring("t+1", 1)));

        List<String> list = new ArrayList<String>();
        list.add("bbbb");
        list.add("aa");
        list.add("ccc");
        list.add("d");

        List<String> collect = list.parallelStream().sorted(Comparator.comparing(String::length).reversed()).collect(Collectors.toList());
        System.out.println(collect);


        String[] src = {"1", "2"};
        List<String> collect1 = Arrays.stream(src).collect(Collectors.toList());
        System.out.println(collect1);
        collect1.add("3");
        collect1.forEach(System.out::println);

        System.out.println(UUID.randomUUID().toString());
    }
}
